package com.mercury.ec.module.air.controller.admin.order.vo.order;

import com.mercury.ec.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;

import static com.mercury.ec.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static com.mercury.ec.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 机票订单分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class AirOrderPageReqVO extends PageParam {

    @Schema(description = "订单号")
    private String no;

    @Schema(description = "订单来源 字典（air_order_source_type 1-手工订单/2-白屏/3-ETERM/4-需求单）", example = "2")
    private Integer sourceType;

    @Schema(description = "来源单号")
    private String sourceNo;

    @Schema(description = "原订单id")
    private Long originOrderId;

    @Schema(description = "原订单号")
    private String originOrderNo;

    @Schema(description = "最后改签类型 字典（air_order_change_type 1-改期/2-升舱）", example = "2")
    private Integer finallyChangeType;

    @Schema(description = "系统客户端 字典（system_client_type 1-中台/2-分销/3-差旅）", example = "2")
    private Integer clientType;

    @Schema(description = "订单类型 字典（air_order_type 1-销售单/2-改签单/3-退票单/4-调账单）", example = "2")
    @NotNull(message = "订单类型不能为空")
    private Integer type;

    @Schema(description = "改签状态 字典（air_order_change_status 0-未改签，1-部分改签，2-已改签）", example = "1")
    private Integer changeStatus;

    @Schema(description = "退票状态 字典（air_order_return_status 0-未退票，1-部分退票，2-已退票）", example = "2")
    private Integer returnStatus;

    @Schema(description = "调账状态 字典（air_order_adjust_status 0-未调账，1-部分调账，2-已调账）", example = "2")
    private Integer adjustStatus;

    @Schema(description = "归属部门id 见表（system_dept.id）", example = "560")
    private Long deptId;

    @Schema(description = "团号")
    private String groupNo;

    @Schema(description = "业务类型 字典（basic_biz_scope_type 1-国内/2-国际）", example = "1")
    private Integer scopeType;

    @Schema(description = "行程类型 字典（air_order_route_type 1-单程/2-往返/3-联程）", example = "2")
    private Integer routeType;

    @Schema(description = "票证类型 字典（basic_vendor_ticket_type 1-BSP/2-B2B/3-B2C/4-GP/5-外购/6-BOP）", example = "2")
    private Integer ticketType;

    @Schema(description = "订座编码")
    private String pnr;

    @Schema(description = "编码状态 HK-预订/XX-取消/RR-出票")
    @Length(max = 8, message = "编码状态长度不能超过8")
    private String pnrStatus;

    @Schema(description = "航司大编码")
    private String bigPnr;

    @Schema(description = "是否携带婴儿", example = "true")
    private Boolean haveBaby;

    @Schema(description = "是否携带儿童", example = "true")
    private Boolean haveChild;

    @Schema(description = "订单状态 字典（air_sale_order_status 0-已取消/10-新订单/20-待审核/25-已拒绝/30-待支付/40-待出票/45-出票中/50-已出票/55-出票失败 air_change_order_status 0-已取消/10-新订单/20-待审核/25-已拒绝/30-待支付/40-待出票/45-出票中/50-已出票/55-出票失败 air_return_order_status 0-已取消/10-新订单/20-待审核/25-已拒绝/30-待退款/40-待退票/45-退票中/50-已退票/55-退票失败 air_adjust_order_status 0-已取消/10-新订单/20-待审核/25-已拒绝/30-待支付/40-待出票/45-出票中/50-已出票/55-出票失败）", example = "1")
    private Integer status;

    @Schema(description = "客户id 见表（basic_customer.id）", example = "16640")
    private Long customerId;

    @Schema(description = "客户编号")
    private String customerNo;

    @Schema(description = "客户名称", example = "李四")
    private String customerName;

    @Schema(description = "客户协议类型 字典（air_customer_agreement_type 1-普通/2-GP/3-三方协议）", example = "2")
    private Integer customerAgreementType;

    @Schema(description = "客户协议号")
    private String customerAgreementNo;

    @Schema(description = "业务员id 见表（system_users.id）", example = "14732")
    private Long salesmanUserId;

    @Schema(description = "业务员部门id 见表（system_dept.id）", example = "22943")
    private Long salesmanDeptId;

    @Schema(description = "预订员id 见表（system_users.id）", example = "2486")
    private Long bookUserId;

    @Schema(description = "预订部门id 见表（system_dept.id）", example = "26302")
    private Long bookDeptId;

    @Schema(description = "预订时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] bookTime;

    @Schema(description = "预订office")
    private String bookOffice;

    @Schema(description = "调度员id 见表（system_users.id）", example = "17733")
    private Long dispatchUserId;

    @Schema(description = "调往部门id 见表（system_dept.id）", example = "19713")
    private Long dispatchDeptId;

    @Schema(description = "调度时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] dispatchTime;

    @Schema(description = "是否锁单")
    private Boolean locked;

    @Schema(description = "锁单员id 见表（system_users.id）", example = "24966")
    private Long lockUserId;

    @Schema(description = "锁单部门id 见表（system_dept.id）", example = "1733")
    private Long lockDeptId;

    @Schema(description = "锁单时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] lockTime;

    @Schema(description = "出（退）票时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] issueTime;

    @Schema(description = "出（退）票员id 见表（system_users.id）", example = "20888")
    private Long issueUserId;

    @Schema(description = "出（退）票部门id 见表（system_dept.id）", example = "12864")
    private Long issueDeptId;

    @Schema(description = "出（退）票渠道id 见表（basic_channel.id）", example = "100")
    private Long issueChannelId;

    @Schema(description = "出票office")
    private String issueOffice;

    @Schema(description = "拒单时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] refuseTime;

    @Schema(description = "拒单员id 见表（system_users.id）", example = "20888")
    private Long refuseUserId;

    @Schema(description = "拒单部门id 见表（system_dept.id）", example = "12864")
    private Long refuseDeptId;

    @Schema(description = "拒单原因")
    private String refuseCause;

    @Schema(description = "审核用户id 见表（system_users.id）", example = "20888")
    private Long auditUserId;

    @Schema(description = "审核部门id 见表（system_dept.id）", example = "12864")
    private Long auditDeptId;

    @Schema(description = "审核时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] auditTime;

    @Schema(description = "审核状态 字典（air_order_audit_status 0-待审核/1-同意/2-拒绝）", example = "1")
    private Integer auditStatus;

    @Schema(description = "审核备注")
    private String auditRemark;

    @Schema(description = "是否需要发票")
    private Boolean needInvoice;

    @Schema(description = "开票方式（需发发票必填） 字典（basic_make_invoice_type 1-统一发票/2-单项发票）", example = "2")
    private Integer makeInvoiceType;

    @Schema(description = "是否回收发票")
    private Boolean recycleInvoice;

    @Schema(description = "发票类型 字典（basic_air_invoice_type）", example = "2")
    private Integer invoiceType;

    @Schema(description = "配送方式 字典（system_delivery_type）", example = "1")
    private Integer deliveryType;

    @Schema(description = "配送备注", example = "你猜")
    private String deliveryRemark;

    @Schema(description = "配送费")
    private Integer deliveryFee;

    @Schema(description = "配送联系人")
    private String deliveryContact;

    @Schema(description = "配送联系人电话")
    private String deliveryContactPhone;

    @Schema(description = "配送城市id 见表（basic_city.id）", example = "13766")
    private Long deliveryCityId;

    @Schema(description = "配送地址")
    private String deliveryAddress;

    @Schema(description = "配送邮箱")
    private String deliveryEmail;

    @Schema(description = "配送员id 见表（system_users.id）")
    private Long deliveryUserId;

    @Schema(description = "配送部门id 见表（system_dept.id）")
    private Long deliveryDeptId;

    @Schema(description = "配送时间")
    private LocalDateTime deliveryTime;

    @Schema(description = "取消规则id 见表（train_cancel_rule.id）", example = "13766")
    private Long cancelRuleId;

    @Schema(description = "取消操作员id 见表（system_users.id）", example = "14219")
    private Long cancelUserId;

    @Schema(description = "取消部门id 见表（system_dept.id）", example = "11064")
    private Long cancelDeptId;

    @Schema(description = "取消时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] cancelTime;

    @Schema(description = "取消原因")
    private String cancelCause;

    @Schema(description = "最后改签员id 见表（system_users.id）", example = "10994")
    private Long finallyChangeUserId;

    @Schema(description = "最后改签部门id 见表（system_dept.id）", example = "32538")
    private Long finallyChangeDeptId;

    @Schema(description = "最后改签时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] finallyChangeTime;

    @Schema(description = "最后退票订单类型 字典（air_order_return_order_type 1-退票/2-废票）", example = "1")
    private Integer finallyReturnOrderType;

    @Schema(description = "最后退票类型 字典（air_order_return_type 1-自愿/2-非自愿）", example = "1")
    private Integer finallyReturnType;

    @Schema(description = "最后退票原因 字典（air_order_return_cause）", example = "1")
    private Integer finallyReturnCause;

    @Schema(description = "最后退票员id 见表（system_users.id）", example = "12414")
    private Long finallyReturnUserId;

    @Schema(description = "最后退票部门id 见表（system_dept.id）", example = "12459")
    private Long finallyReturnDeptId;

    @Schema(description = "最后退票时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] finallyReturnTime;

    @Schema(description = "最后调账类型 字典（air_order_adjust_type 1-/2-/3-）", example = "2")
    private Integer finallyAdjustType;

    @Schema(description = "最后调账员id 见表（system_users.id）", example = "16600")
    private Long finallyAdjustUserId;

    @Schema(description = "最后调账部门id 见表（system_dept.id）", example = "1237")
    private Long finallyAdjustDeptId;

    @Schema(description = "最后调账时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] finallyAdjustTime;

    @Schema(description = "结算方式 字典（system_settle_type）", example = "2")
    private Integer saleSettleType;

    @Schema(description = "支付状态 字典（system_pay_status）", example = "2")
    private Integer salePayStatus;

    @Schema(description = "支付方式id 见表（basic_pay_type.id）", example = "15844")
    private Long salePayTypeId;

    @Schema(description = "支付科目id 见表（basic_pay_subject.id）", example = "27542")
    private Long salePaySubjectId;

    @Schema(description = "支付账号", example = "20047")
    private String salePayAccount;

    @Schema(description = "支付单号")
    private String salePayOrderNo;

    @Schema(description = "支付时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] salePayTime;

    @Schema(description = "是否在线支付")
    private Boolean salePayOnline;

    @Schema(description = "对账日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate[] saleReconcileDate;

    @Schema(description = "结算日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate[] saleSettleDate;

    @Schema(description = "采购商id 见表（basic_vendor.id）", example = "28311")
    private Long purchaseId;

    @Schema(description = "采购单号")
    private String purchaseOrderNo;

    @Schema(description = "采购支付状态 字典（system_pay_status）", example = "1")
    private Integer purchasePayStatus;

    @Schema(description = "采购支付科目id 见表（basic_pay_subject.id）", example = "22116")
    private Long purchasePaySubjectId;

    @Schema(description = "采购支付方式id 见表（basic_pay_type.id）", example = "8940")
    private Long purchasePayTypeId;

    @Schema(description = "采购支付账号", example = "4194")
    private String purchasePayAccount;

    @Schema(description = "采购支付单号")
    private String purchasePayOrderNo;

    @Schema(description = "采购支付时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] purchasePayTime;

    @Schema(description = "采购是否在线支付")
    private Boolean purchasePayOnline;

    @Schema(description = "采购对账日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate[] purchaseReconcileDate;

    @Schema(description = "采购结算日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate[] purchaseSettleDate;

    @Schema(description = "联系人")
    private String contact;

    @Schema(description = "联系人证件类型 字典（system_card_type）", example = "1")
    private Integer contactCardType;

    @Schema(description = "联系人证件号")
    private String contactCardNo;

    @Schema(description = "联系人电话")
    private String contactPhone;

    @Schema(description = "联系人手机")
    private String contactMobile;

    @Schema(description = "联系人邮箱")
    private String contactEmail;

    @Schema(description = "备注", example = "你说的对")
    private String remark;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    // 子表查询条件
    @Schema(description = "乘客姓名")
    private String passengerName;

    @Schema(description = "票号")
    private String ticketNo;

    @Schema(description = "航班号")
    private String flightNo;
}
